package org.linlinjava.litemall.wx.web;

import org.linlinjava.litemall.core.qcode.QCodeService;
import org.linlinjava.litemall.wx.annotation.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/wx/qCode")
public class QCodeController {
    @Autowired
    private QCodeService qCodeService;

    /**
     * 创建分享书评二维码码
     * @param userId
     * @param bookReviewId
     * @return
     */
    @PostMapping("/shareBookReview")
    public Object createShareBookReviewImage(@LoginUser Integer userId, @RequestBody Integer bookReviewId) {
        return qCodeService.createShareBookReviewImage(userId, bookReviewId);
    }

    /**
     * 创建分享书单二维码
     */
    @PostMapping("/shareBookList")
    public Object createShareBookListImage(@LoginUser Integer userId, @RequestBody Integer bookListId) {
        return qCodeService.createShareBookListImage(userId, bookListId);
    }

    /**
     * 创建分享阅读报告二维码
     * @param userId
     * @return
     */
    @PostMapping("/shareReadingReport")
    public Object createShareReadingReportImage(@LoginUser Integer userId) {
        return qCodeService.createShareReadingReportImage(userId);
    }
}
